1. Technical Field
The present invention relates generally to data processing. Specifically, the present invention relates to a method and system for transforming an Extensible Markup Language (XML) document structured according to a set of XML grammar rules to at least one XML document structured according to a subset of the set of XML grammar rules.
2. Background of the Related Art
Extensible Markup Language (XML) is emerging as a universal language for structuring documents for transmission via the World Wide Web (WWW). XML includes a set of XML grammar rules for structuring documents, primarily web-based documents, in order to provide extensibility, portability, and adaptability of such documents.
For example, XML 1.0 which includes a grammar rule set of over eighty grammar rules provides clients with increased document processing capabilities, such as quickly accessing specific data via the Internet in response to a search query and reducing the processing load on servers by performing less document searching routines to locate a specific document. Accordingly, XML is a tool that significantly reduces network data traffic and improves query search response times.
In order to process a document structured in XML, the XML document is first parsed by an XML parser. The XML parser is typically a set of programmable instructions stored within a computing device, such as a server or a PC. The XML parser extracts data elements of the XML document in accordance with the XML grammar rule set. Second, an Extensible Style Language (XSL) style sheet accompanying the XML document is accessed. The XSL style sheet sets forth instructions for retrieving selected extracted data elements of the XML document and reformatting them to another format for presentation thereof or transformation to web-based language, such as HTML.
The extracted data elements and the XSL style sheet are provided to an Extensible Style Language Transformation (XSLT) engine having software modules for transforming each extracted data element in accordance with the instructions set forth by the XSL style sheet.
Personal digital assistants (PDAs), cellular telephones, set-top boxes, etc. capable of accessing the Internet or other network for allowing clients to engage in e-commerce and access data through wired or wireless network connections have limited processing and information storage resources. Hence, these computing devices, also known as thin devices, when receiving XML documents and XSL style sheets, e.g., via a network, typically do not have adequate resources for processing and storing the programmable instructions of an XML parser for parsing the received XML documents to extract data elements. They also typically do not have adequate resources for processing and storing the software modules of the XSLT engine for transforming the extracted data elements according to the instructions set forth by the XSL style sheet.
Accordingly, thin devices have been proposed where a micro-parser is provided therein for parsing the received XML documents to extract data elements. The micro-parser would contain programmable instructions indicative of only a subset of the XML grammar rule set to forego from over-loading the processing resources and from using too much of the storage resources of the thin device for storing the entire XML grammar rule set. Therefore, XML documents received by such a thin device would have to be structured according to the subset of the XML grammar rule set, i.e., the subset of grammar rules that the micro-parser of the thin device is programmed with, in order to enable the thin device to correctly parse and transform the incoming XML documents to a usable and understandable format.
It is, however, impractical and unrealistic to provide all thin devices with the same micro-parser. As such, it is envisioned that many thin devices would be brought to market where each thin device is likely to have a different micro-parser than another thin device, i.e., a micro-parser of a cellular telephone would be likely to be programmed with a different subset of the XML grammar rule set than a micro-parser of a PDA. For example; the cellular telephone is likely to have a micro-parser programmed with seven XML grammar rules and the PDA is likely to have a micro-parser programmed with twelve XML grammar rules.
Hence, an XML document having data structured in XML according to the full set of XML grammar rules is not likely to be correctly transformed or translated by computing devices which have micro-parsers programmed with only a subset of the full set of XML grammar rules.
A need therefore exists for a method and system for correctly transforming an XML document structured according to a set of XML grammar rules to one or more XML documents structured according to one or more subsets of the set of XML grammar rules.
The present invention provides a method and system for transforming an XML document structured according to a set of XML grammar rules to at least one XML document structured according to at least one subset of the set of XML grammar rules. The system of the present invention includes a controller capable of executing a set of programmable instructions for retrieving at least one grammar restriction style sheet (GRSS) corresponding to at least one subset of a set of XML grammar rules, where the at least one GRSS includes transformation rules for transforming an XML document to at least one XML document structured according to the at least one subset of the set of XML grammar rules; and a transformation engine for using the transformation rules of each retrieved GRSS for transforming data elements of the XML document to data elements structured according to the at least one subset of the set of XML grammar rules to transform the XML document to the at least one XML document structured according to the at least one subset of the set of XML grammar rules.
The method includes the steps of retrieving at least one GRSS corresponding to the at least one subset of a set of XML grammar rules, where the at least one GRSS includes transformation rules for transforming an XML document to at least one XML document structured according to the at least one subset of the set of XML grammar rules; and transforming data elements of the XML document using the transformation rules of the at least one retrieved GRSS to data elements structured according to the at least one subset of the set of XML grammar rules to transform the XML document to the at least one XML document structured according to the at least one subset of the set of XML grammar rules.